public without sharing class ResponsibleServerHandler {


	public static void setUserCode(List<ResponsibleServer__c> list_new ,Map<Id,ResponsibleServer__c>oldMap){

		List<User> uList = new List<User>(); 
			for (ResponsibleServer__c r : list_new) {
				if(r.PriorityUser__c != null){
					if(oldMap == null || (oldMap != null && (oldMap.get(r.Id).PriorityUser__c != r.PriorityUser__c || oldMap.get(r.Id).ResponseCode__c != r.ResponseCode__c ))){
						User u = new User();
						u.Id = r.PriorityUser__c;
						u.ResponseCode__c = r.ResponseCode__c;
						uList.add(u);
					}
					
				}
		}
		if(uList.size() > 0 && !Test.isRunningTest()) update uList;
	}
    
}